package cn.lan.generator.bean;

/**
 * 模块
 */
public class Module {

    private String projectSimpleName;
    private String moduleName;

    private static Module module = null;

    public static Module getModule(ProjInfo projInfo){
        if(module==null){
            module = new Module(projInfo.getProjectSimpleName(), projInfo.getModuleName());
        }
        return module;
    }

    public static void setEmptyModule(){
        module = null;
    }

    private Module(String projectSimpleName,String moduleName) {
        this.moduleName = moduleName;
        this.projectSimpleName = projectSimpleName;
    }

    public String getCommon() {
        return projectSimpleName+"-common";
    }

    public String getWebServer() {
        return projectSimpleName+"-web-server";
    }

    public String getService() {
        return projectSimpleName+"-"+moduleName;
    }

}
